Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature to read RT Dose files #35

Merged
merged 2 commits into from
Dec 15, 2023
Merged

Feature to read RT Dose files #35

merged 2 commits into from
Dec 15, 2023

Conversation

amithjkamath
Copy link
Collaborator

This change includes a new image type called DoseImage which then includes the scaling factor and also reduces the dimensions of dose volumes to be 3D (in case it is 4D by default).

  • [ x] New feature (non-breaking change which adds functionality)

Testing Description

The existing tests have been run and nothing breaks (except for an unrelated issue: see
unit/fileio/writing/test_dicom_series_subject_writer.py:64 (test__write_to_zip_4)
img_series_dcm = '/private/var/folders/yr/q_0gpqgs1lq_rtbttpk3n9bh0000gn/T/pytest-of-amithkamath/pytest-0/data10'
empty_folder = '/private/var/folders/yr/q_0gpqgs1lq_rtbttpk3n9bh0000gn/T/pytest-of-amithkamath/pytest-0/data11'

def test__write_to_zip_4(img_series_dcm, empty_folder):
    ds, dicom_path = helper_get_ds(img_series_dcm)
    info = DicomSeriesImageInfo((dicom_path,))
    subject_writer = DicomSeriesSubjectWriter()
    subject_writer._write_to_zip((info,), (("dataset", ds),), empty_folder, "folder_name")

    with ZipFile(os.path.join(empty_folder, "folder_name.zip"), "r") as zip_ref:
        zip_ref.extractall(empty_folder)

    with open(dicom_path, "rb") as file:
        ds_original = pydicom.dcmread(file)
  with open(os.path.join(empty_folder, "img_serie_14.dcm"), "rb") as f:

E FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/yr/q_0gpqgs1lq_rtbttpk3n9bh0000gn/T/pytest-of-amithkamath/pytest-0/data11/img_serie_14.dcm'

unit/fileio/writing/test_dicom_series_subject_writer.py:77: FileNotFoundError

  • [ x] I have performed a self-review of my code and have run it by Mike already.

@amithjkamath amithjkamath self-assigned this Dec 14, 2023
@amithjkamath
Copy link
Collaborator Author

This change also fixes the issue: #2

Copy link
Collaborator

@melandur melandur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your extensions is well appreciated

@melandur melandur merged commit 6e556db into ubern-mia:main Dec 15, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants